﻿<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
			 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
			 xmlns:w="http://schemas.jelle.druyts.net/2010/xaml/presentation"
			 xmlns:svc="clr-namespace:Schedulr.Views.Controls"
			 x:Class="Schedulr.Views.Controls.PictureDetails"
			 d:DesignHeight="500"
			 d:DesignWidth="500"
			 mc:Ignorable="d">
	<Grid>
		<Grid>
			<Grid.Style>
				<Style TargetType="Grid">
					<Setter Property="Visibility" Value="Collapsed" />
					<Style.Triggers>
						<DataTrigger Binding="{Binding Path=Picture}" Value="{x:Null}">
							<Setter Property="Visibility" Value="Visible" />
						</DataTrigger>
					</Style.Triggers>
				</Style>
			</Grid.Style>
			<TextBlock Text="Please select one or more files to edit" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="{DynamicResource InfoFontBrush}" />
		</Grid>
		<Grid>
			<Grid.Style>
				<Style TargetType="Grid">
					<Setter Property="Visibility" Value="Visible" />
					<Style.Triggers>
						<DataTrigger Binding="{Binding Path=Picture}" Value="{x:Null}">
							<Setter Property="Visibility" Value="Collapsed" />
						</DataTrigger>
					</Style.Triggers>
				</Style>
			</Grid.Style>
			<Grid.RowDefinitions>
				<RowDefinition Height="*" />
				<RowDefinition Height="Auto" />
			</Grid.RowDefinitions>
			<ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Auto">
				<TabControl Margin="10,10,10,10">
					<TabItem Header="Details">
						<StackPanel Margin="0,10,0,0">
							<Expander Style="{StaticResource IndentedContentExpander}" Header="Online" Margin="0,0,0,10" Visibility="{Binding OnlineDetailsVisibility}" IsExpanded="{Binding Path=UISettings.OnlinePanelIsExpanded, FallbackValue=True}">
								<StackPanel>
									<Label Content="Web Page" Style="{StaticResource SeparatingLabel}" />
									<TextBlock><w:ExternalHyperlink Foreground="{DynamicResource InfoFontBrush}" NavigateUri="{Binding Path=Picture.WebUrl}" ToolTip="{Binding Path=Picture.WebUrl}"><Run Text="{Binding Path=Picture.Title}" /></w:ExternalHyperlink></TextBlock>
									<Label Content="Date Uploaded" Style="{StaticResource SeparatingLabel}" />
									<TextBlock Foreground="{DynamicResource InfoFontBrush}" Text="{Binding Path=Picture.DateUploaded, StringFormat=f}" />
								</StackPanel>
							</Expander>
							<Expander Style="{StaticResource IndentedContentExpander}" Header="Details" Margin="0,0,0,0" IsExpanded="{Binding Path=UISettings.DetailsPanelIsExpanded, FallbackValue=True}">
								<StackPanel>
									<Grid Visibility="{Binding FileDetailsVisibility}">
										<Grid.ColumnDefinitions>
											<ColumnDefinition Width="*" />
											<ColumnDefinition Width="Auto" />
										</Grid.ColumnDefinitions>
										<StackPanel Grid.Column="0">
											<Label Content="_Path" Target="{Binding ElementName=fileNameTextBox, Mode=OneWay}" Style="{StaticResource SeparatingLabel}" />
											<TextBox IsReadOnly="True" x:Name="fileNameTextBox" Text="{Binding Path=Picture.FileName, Mode=OneWay}" PreviewMouseLeftButtonUp="fileNameTextBox_PreviewMouseLeftButtonUp">
												<TextBox.Style>
													<Style TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
														<Style.Triggers>
															<DataTrigger Binding="{Binding Path=FileNameLinkEnabled}" Value="true">
																<Setter Property="TextDecorations" Value="Underline" />
																<Setter Property="Cursor" Value="Hand" />
															</DataTrigger>
														</Style.Triggers>
													</Style>
												</TextBox.Style>
											</TextBox>
										</StackPanel>
										<StackPanel Grid.Column="1" Margin="5,0,0,0">
											<Label Content="_Size" Target="{Binding ElementName=fileSizeTextBox, Mode=OneWay}" Style="{StaticResource SeparatingLabel}" />
											<TextBox IsReadOnly="True" x:Name="fileSizeTextBox" Text="{Binding Path=FileSizeDescription, Mode=OneWay}">
												<TextBox.Style>
													<Style TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
														<Style.Triggers>
															<DataTrigger Binding="{Binding FileSizeErrorVisibility}" Value="Visible">
																<Setter Property="BorderBrush" Value="{DynamicResource ErrorForegroundBrush}" />
																<Setter Property="Foreground" Value="{DynamicResource ErrorForegroundBrush}" />
																<Setter Property="ToolTip" Value="The file is larger than the maximum file size you are allowed to upload." />
															</DataTrigger>
														</Style.Triggers>
													</Style>
												</TextBox.Style>
											</TextBox>
										</StackPanel>
									</Grid>
									<Label Content="_Title" Target="{Binding ElementName=titleTextBox, Mode=OneWay}" Style="{StaticResource SeparatingLabel}" />
									<TextBox x:Name="titleTextBox" Text="{Binding Path=Picture.Title, Mode=TwoWay}" IsReadOnly="{Binding IsReadOnly}" />
									<Label Content="_Description" Target="{Binding ElementName=descriptionTextBox, Mode=OneWay}" Style="{StaticResource SeparatingLabel}" />
									<TextBox x:Name="descriptionTextBox" Text="{Binding Path=Picture.Description, Mode=TwoWay}" Height="100" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap" IsReadOnly="{Binding IsReadOnly}" />
									<Label Content="{Binding TagsLabel}" Target="{Binding ElementName=tagsTextBox, Mode=OneWay}" Style="{StaticResource SeparatingLabel}" />
									<TextBox x:Name="tagsTextBox" Text="{Binding Path=Picture.Tags, Mode=TwoWay}" IsReadOnly="{Binding IsReadOnly}" />
								</StackPanel>
							</Expander>
							<Expander Style="{StaticResource IndentedContentExpander}" Header="Settings" Margin="0,10,0,0" IsExpanded="{Binding Path=UISettings.SettingsPanelIsExpanded, FallbackValue=True}">
								<WrapPanel>
									<StackPanel Margin="0,0,20,0">
										<Label Content="_Visibility" Target="{Binding ElementName=visibilityIsPublicCheckBox, Mode=OneWay}" Style="{StaticResource SeparatingLabel}" />
										<CheckBox x:Name="visibilityIsPublicCheckBox" ToolTip="Visible to everyone" IsChecked="{Binding Path=Picture.VisibilityIsPublic, Mode=TwoWay}" IsEnabled="{Binding IsEditable}">
											<Label Content="Public" />
										</CheckBox>
										<CheckBox x:Name="visibilityIsFamilyCheckBox" ToolTip="Visible to your family" IsChecked="{Binding Path=Picture.VisibilityIsFamily, Mode=TwoWay}" IsEnabled="{Binding IsEditable}">
											<Label Content="Family" />
										</CheckBox>
										<CheckBox x:Name="visibilityIsFriendCheckBox" ToolTip="Visible to your friends" IsChecked="{Binding Path=Picture.VisibilityIsFriend, Mode=TwoWay}" IsEnabled="{Binding IsEditable}">
											<Label Content="Friends" />
										</CheckBox>
									</StackPanel>
									<StackPanel Margin="0,0,20,0">
										<Label Content="S_earch Visibility" Target="{Binding ElementName=searchVisibilityIsNoneRadioButton, Mode=OneWay}" Style="{StaticResource SeparatingLabel}" />
										<RadioButton x:Name="searchVisibilityIsNoneRadioButton" ToolTip="Use the default value you configured on your Flickr account" IsChecked="{Binding Path=Picture.SearchVisibility, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=None}" IsEnabled="{Binding IsEditable}">
											<Label Content="Default" />
										</RadioButton>
										<RadioButton x:Name="searchVisibilityIsVisibleRadioButton" ToolTip="Publicly searchable" IsChecked="{Binding Path=Picture.SearchVisibility, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=Visible}" IsEnabled="{Binding IsEditable}">
											<Label Content="Visible" />
										</RadioButton>
										<RadioButton x:Name="searchVisibilityIsHiddenRadioButton" ToolTip="Hidden from public areas, such as Search and Explore" IsChecked="{Binding Path=Picture.SearchVisibility, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=Hidden}" IsEnabled="{Binding IsEditable}">
											<Label Content="Hidden" />
										</RadioButton>
									</StackPanel>
									<StackPanel Margin="0,0,20,0">
										<Label Content="_Safety" Target="{Binding ElementName=safetyIsNoneRadioButton, Mode=OneWay}" Style="{StaticResource SeparatingLabel}" />
										<RadioButton x:Name="safetyIsNoneRadioButton" ToolTip="Use the default value you configured on your Flickr account" IsChecked="{Binding Path=Picture.Safety, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=None}" IsEnabled="{Binding IsEditable}">
											<Label Content="Default" />
										</RadioButton>
										<RadioButton x:Name="safetyIsSafeRadioButton" ToolTip="Content suitable for a global, public audience" IsChecked="{Binding Path=Picture.Safety, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=Safe}" IsEnabled="{Binding IsEditable}">
											<Label Content="Safe" />
										</RadioButton>
										<RadioButton x:Name="safetyIsModerateRadioButton" ToolTip="If you're not sure whether your content is suitable for a global, public audience but you think that it doesn't need to be restricted per se, this category is for you" IsChecked="{Binding Path=Picture.Safety, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=Moderate}" IsEnabled="{Binding IsEditable}">
											<Label Content="Moderate" />
										</RadioButton>
										<RadioButton x:Name="safetyIsRestrictedRadioButton" ToolTip="This is content you probably wouldn't show to your mum, and definitely shouldn't be seen by kids" IsChecked="{Binding Path=Picture.Safety, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=Restricted}" IsEnabled="{Binding IsEditable}">
											<Label Content="Restricted" />
										</RadioButton>
									</StackPanel>
									<StackPanel Margin="0,0,20,0">
										<Label Content="Ty_pe" Target="{Binding ElementName=contentTypeIsNoneRadioButton, Mode=OneWay}" Style="{StaticResource SeparatingLabel}" />
										<RadioButton x:Name="contentTypeIsNoneRadioButton" ToolTip="Use the default value you configured on your Flickr account" IsChecked="{Binding Path=Picture.ContentType, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=None}" IsEnabled="{Binding IsEditable}">
											<Label Content="Default" />
										</RadioButton>
										<RadioButton x:Name="contentTypeIsPhotoRadioButton" ToolTip="Photos or videos" IsChecked="{Binding Path=Picture.ContentType, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=Photo}" IsEnabled="{Binding IsEditable}">
											<Label Content="Photo" />
										</RadioButton>
										<RadioButton x:Name="contentTypeIsScreenshotRadioButton" ToolTip="Screenshots or screencasts" IsChecked="{Binding Path=Picture.ContentType, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=Screenshot}" IsEnabled="{Binding IsEditable}">
											<Label Content="Screenshot" />
										</RadioButton>
										<RadioButton x:Name="contentTypeIsOtherRadioButton" ToolTip="Illustration, art, animation, CGI or other non-photographic images" IsChecked="{Binding Path=Picture.ContentType, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=Other}" IsEnabled="{Binding IsEditable}">
											<Label Content="Other" />
										</RadioButton>
									</StackPanel>
									<StackPanel Margin="0,0,20,0">
										<Label Content="_License" Target="{Binding ElementName=licenseComboBox, Mode=OneWay}" Style="{StaticResource SeparatingLabel}" />
										<ComboBox x:Name="licenseComboBox" IsEnabled="{Binding IsEditable}">
											<ComboBoxItem x:Name="licenseIsNoneRadioButton" Content="Default" ToolTip="Use the default value you configured on your Flickr account" IsSelected="{Binding Path=Picture.License, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=None}" IsEnabled="{Binding IsEditable}" />
											<ComboBoxItem x:Name="licenseIsAllRightsReservedRadioButton" Content="None (All rights reserved)" IsSelected="{Binding Path=Picture.License, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=AllRightsReserved}" IsEnabled="{Binding IsEditable}" />
											<ComboBoxItem x:Name="licenseIsAttributionNoncommercialShareAlikeCC" Content="Attribution-NonCommercial-ShareAlike Creative Commons" IsSelected="{Binding Path=Picture.License, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=AttributionNoncommercialShareAlikeCC}" IsEnabled="{Binding IsEditable}" />
											<ComboBoxItem x:Name="licenseIsAttributionNoncommercialCC" Content="Attribution-NonCommercial Creative Commons" IsSelected="{Binding Path=Picture.License, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=AttributionNoncommercialCC}" IsEnabled="{Binding IsEditable}" />
											<ComboBoxItem x:Name="licenseIsAttributionNoncommercialNoDerivativesCC" Content="Attribution-NonCommercial-NoDerivs Creative Commons" IsSelected="{Binding Path=Picture.License, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=AttributionNoncommercialNoDerivativesCC}" IsEnabled="{Binding IsEditable}" />
											<ComboBoxItem x:Name="licenseIsAttributionCC" Content="Attribution Creative Commons" IsSelected="{Binding Path=Picture.License, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=AttributionCC}" IsEnabled="{Binding IsEditable}" />
											<ComboBoxItem x:Name="licenseIsAttributionShareAlikeCC" Content="Attribution-ShareAlike Creative Commons" IsSelected="{Binding Path=Picture.License, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=AttributionShareAlikeCC}" IsEnabled="{Binding IsEditable}" />
											<ComboBoxItem x:Name="licenseIsAttributionNoDerivativesCC" Content="Attribution-NoDerivs Creative Commons" IsSelected="{Binding Path=Picture.License, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=AttributionNoDerivativesCC}" IsEnabled="{Binding IsEditable}" />
										</ComboBox>
									</StackPanel>
								</WrapPanel>
							</Expander>
						</StackPanel>
					</TabItem>
					<TabItem Header="Sets &amp; Groups">
						<StackPanel Margin="0,10,0,0">
							<Expander Style="{StaticResource IndentedContentExpander}" Header="{Binding Path=Sets.Description}" IsExpanded="{Binding Path=UISettings.SetsPanelIsExpanded, FallbackValue=True}">
								<StackPanel Orientation="Vertical">
									<WrapPanel Margin="0,0,0,5">
										<TextBlock Text="Sort by" VerticalAlignment="Center" Margin="0,0,5,0" />
										<Button Content="User Order" ToolTip="Sort by user order" Command="{Binding Path=Sets.SortByUserOrderCommand}" Margin="0,0,5,0" Style="{StaticResource MediumButton}" />
										<Button Content="Name" ToolTip="Sort by name" Command="{Binding Path=Sets.SortByNameCommand}" Margin="0,0,5,0" Style="{StaticResource MediumButton}" />
										<Button Content="Age" ToolTip="Sort by age" Command="{Binding Path=Sets.SortByAgeCommand}" Margin="0,0,5,0" Style="{StaticResource MediumButton}" />
										<Button Content="Size" ToolTip="Sort by number of items" Command="{Binding Path=Sets.SortBySizeCommand}" Style="{StaticResource MediumButton}" />
									</WrapPanel>
									<ListBox ItemsSource="{Binding Path=Sets.Items}" Style="{Binding FlickrCollectionListStyle}" IsEnabled="{Binding IsEditable}" />
								</StackPanel>
							</Expander>
							<Expander Style="{StaticResource IndentedContentExpander}" Header="{Binding Path=Groups.Description}" Margin="0,10,0,0" IsExpanded="{Binding Path=UISettings.GroupsPanelIsExpanded, FallbackValue=True}">
								<StackPanel Orientation="Vertical">
									<WrapPanel Margin="0,0,0,5">
										<TextBlock Text="Sort by" VerticalAlignment="Center" Margin="0,0,5,0" />
										<Button Content="Name" ToolTip="Sort by name" Command="{Binding Path=Groups.SortByNameCommand}" Margin="0,0,5,0" Style="{StaticResource MediumButton}" />
										<Button Content="Age" ToolTip="Sort by age" Command="{Binding Path=Groups.SortByAgeCommand}" Margin="0,0,5,0" Style="{StaticResource MediumButton}" />
										<Button Content="Size" ToolTip="Sort by size" Command="{Binding Path=Groups.SortBySizeCommand}" Style="{StaticResource MediumButton}" />
									</WrapPanel>
									<ListBox ItemsSource="{Binding Path=Groups.Items}" Style="{Binding FlickrCollectionListStyle}" IsEnabled="{Binding IsEditable}" />
								</StackPanel>
							</Expander>
						</StackPanel>
					</TabItem>
					<TabItem Header="Location">
						<StackPanel Margin="0,10,0,0">
							<Expander Style="{StaticResource IndentedContentExpander}" Header="Location" IsExpanded="{Binding Path=UISettings.LocationPanelIsExpanded, FallbackValue=True}">
								<StackPanel Orientation="Vertical">
									<ItemsControl Margin="0,0,0,10" ItemsSource="{Binding LocationCommands}" Visibility="{Binding LocationCommandsVisibility}">
										<ItemsControl.ItemsPanel>
											<ItemsPanelTemplate>
												<WrapPanel Orientation="Horizontal" />
											</ItemsPanelTemplate>
										</ItemsControl.ItemsPanel>
										<ItemsControl.ItemTemplate>
											<DataTemplate>
												<Button Content="{Binding Name}" ToolTip="{Binding Description}" Command="{Binding}" Margin="0,5,5,0" />
											</DataTemplate>
										</ItemsControl.ItemTemplate>
									</ItemsControl>
									<Grid HorizontalAlignment="Left">
										<TextBlock Text="No location defined" />
										<svc:GeoLocationMap Visibility="{Binding Path=LocationVisibility}" Location="{Binding Path=Picture.Location, Mode=TwoWay}" GeoLocationMapProvider="{Binding Path=Account.Settings.GeoLocationMapType, Mode=TwoWay}"  IsReadOnly="True" Height="300" Width="400" />
									</Grid>
								</StackPanel>
							</Expander>
						</StackPanel>
					</TabItem>
					<TabItem Header="Batch" Visibility="{Binding BatchDetailsVisibility}">
						<StackPanel Margin="0,10,0,0">
							<Expander Style="{StaticResource IndentedContentExpander}" Header="Batch" Visibility="{Binding BatchDetailsVisibility}" IsExpanded="{Binding Path=UISettings.BatchPanelIsExpanded, FallbackValue=True}">
								<StackPanel>
									<CheckBox IsChecked="{Binding Path=Batch.CreatePhotosetForBatch, Mode=TwoWay}" IsEnabled="{Binding IsEditable}">
										<Label Content="Create a new set for this batch" />
									</CheckBox>
									<StackPanel IsEnabled="{Binding Path=Batch.CreatePhotosetForBatch}" Margin="20,0,0,0">
										<Label Content="_Name" Target="{Binding ElementName=setNameTextBox, Mode=OneWay}" Style="{StaticResource SeparatingLabel}" />
										<TextBox x:Name="setNameTextBox" Text="{Binding Path=Batch.Photoset.Name, Mode=TwoWay}" IsReadOnly="{Binding IsReadOnly}" />
										<Label Content="_Description" Target="{Binding ElementName=setDescripionTextBox, Mode=OneWay}" Style="{StaticResource SeparatingLabel}" />
										<TextBox x:Name="setDescripionTextBox" Text="{Binding Path=Batch.Photoset.Description, Mode=TwoWay}" Height="100" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap" IsReadOnly="{Binding IsReadOnly}" />
										<Label Content="_Primary picture or video" Target="{Binding ElementName=setPrimaryPictureComboBox, Mode=OneWay}" Style="{StaticResource SeparatingLabel}" />
										<ComboBox x:Name="setPrimaryPictureComboBox" ItemsSource="{Binding Path=BatchPictures}" SelectedValue="{Binding Path=Batch.Photoset.PrimaryPictureId}" SelectedValuePath="FileName" IsEnabled="{Binding IsEditable}" ItemTemplate="{DynamicResource PictureDataTemplate}" Margin="0" >
											<ComboBox.Resources>
												<DataTemplate x:Key="PictureDataTemplate">
													<Grid>
														<Grid.ColumnDefinitions>
															<ColumnDefinition Width="48"/>
															<ColumnDefinition Width="*"/>
														</Grid.ColumnDefinitions>
														<w:BackgroundLoadingImage Source="/Resources/Anonymous.png" ActualSource="{Binding FileName}" MaxWidth="48" MaxHeight="48" DecodePixelWidth="48" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
														<TextBlock Text="{Binding ShortFileName}" Grid.Column="1" MinWidth="10" VerticalAlignment="Center" Margin="2,0,0,0"/>
													</Grid>
												</DataTemplate>
											</ComboBox.Resources>
											
										</ComboBox>
									</StackPanel>
								</StackPanel>
							</Expander>
						</StackPanel>
					</TabItem>
				</TabControl>
			</ScrollViewer>
			<Border Grid.Row="1" Style="{DynamicResource BorderStyle}" Background="Transparent" Padding="5" Margin="5" Visibility="{Binding InfoMessageVisibility}">
				<TextBlock FontStyle="Italic" Foreground="{DynamicResource InfoFontBrush}" HorizontalAlignment="Right" Margin="0,0,10,0" Text="{Binding InfoMessage}" />
			</Border>
		</Grid>
	</Grid>
</UserControl>